$Description$
$n$个仓库$m$个商店.$i$仓库有$a_i$单位货物,$i$商店需要$b_i$单位货物。$i$仓库到$j$商店的运费是$c_{i,j} /\text{单位}$。问最小运输费用和最大运输费用。
$Solution$
费用流水题
对于每个仓库$i$,每个商店$j$
$s \stackrel{a_{i}, 0}{\longrightarrow}i$
$i \stackrel{inf, c_{i,j}}{\longrightarrow}i$
$j \stackrel{b_{i}, 0}{\longrightarrow}t$
分别跑最小费用最大流和最大费用最大流即可
$Code$
1 |
|